my table
+------+-------+---------+-------+--------+
| Name | Group1| Section | Marks | Points |
+------+-------+---------+-------+--------+
| S1 | G1
You can do an update join to achieve what you want;
UPDATE students
JOIN (
SELECT marks, (@sp:=@sp-2) a
FROM (
SELECT distinct marks FROM students
WHERE section='class1' AND group1 IS NOT NULL
GROUP BY group1 ORDER BY marks DESC LIMIT 3
) b, (SELECT @sp:=7) c
) d
SET students.points = d.a
WHERE students.marks = d.marks
AND section='class1'
AND group1 IS NOT NULL;
(posted this answer also to your second question where you seemed to ask for an update statement without noticing that it was a duplicate, moved it here)
An SQLfiddle to test with.