update table_name01 t1
    left join table_name02 t2 on t1.id = t2.refer_id
    set t1.status = 1
    where t2.status =2;