Ensure that only one record has a specific value
That can't be performed with single query. Therefore you have to create stored routine like that:

CREATE PROCEDURE `start_job`( IN `pid` INT, IN `state` varchar )
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
BEGIN
   UPDATE * 
     FROM jobs AS w
      SET w.status = "idle"
    WHERE w.status = "running"
   ;
   INSERT INTO jobs (id, status)
   VALUES (pid, state)
       ON DUPLICATE KEY UPDATE
          status = state
   ;
END