SQL Error (1093): Table 'j1' is specified twice, both as a target for 'UPDATE' and as a separate source for data I get the above error while I execute the below query

UPDATE jobs AS j1 SET j1.job_last_status = 10, j1.updated_at = '2020-05-04 09:59:11'
WHERE j1.id IN (SELECT jh.job_id
FROM jobs_history AS jh 
INNER JOIN jobs j ON j.id = jh.job_id AND j.job_last_status =7 
WHERE jh.job_status = 7 
GROUP BY jh.job_id 
HAVING COUNT(jh.job_id) =2)
UPDATE jobs j1, ( SELECT jh.job_id
                  FROM jobs_history AS jh 
                  INNER JOIN jobs j ON j.id = jh.job_id 
                                   AND j.job_last_status =7 
                  WHERE jh.job_status = 7 
                  GROUP BY jh.job_id 
                  HAVING COUNT(jh.job_id) = 2 ) j2
SET j1.job_last_status = 10, 
    j1.updated_at = '2020-05-04 09:59:11'
WHERE j1.id = j2.job_id


or the same in JOIN form:

UPDATE jobs j1
  JOIN ( SELECT jh.job_id
         FROM jobs_history AS jh 
         INNER JOIN jobs j ON j.id = jh.job_id 
                          AND j.job_last_status =7 
         WHERE jh.job_status = 7 
         GROUP BY jh.job_id 
         HAVING COUNT(jh.job_id) = 2 ) j2 ON j1.id = j2.job_id
SET j1.job_last_status = 10, 
    j1.updated_at = '2020-05-04 09:59:11'