Update + where not exist
Your query can be collapsed to the single JOIN without subselects: 

UPDATE      student_activity AS c 
  LEFT JOIN student_activity AS b ON c.student_id = b.student_id 
                                 AND c.class_type = b.class_type
                                 AND c.date &gt; b.date
 WHERE b.date IS NULL 
   SET c.first_attendance = c.date
;


I hope your table student_activity have the index (student_id, class_type, date)