Mysql multiple check and multiple update queries
I can suggest little more longer method, but work fine:


Load file into table, for example TableB (original in this case TableA), TableB has only PK - id
Update - before INSERT

UPDATE TableA t1 INNER JOIN TableB t2 ON t1.id = t2.id

Insert

INSERT INTO TableA 
SELECT * 
FROM TableB t1 
WHERE NOT EXISTS 
      (SELECT id FROM TableA t2 WHERE t2.id = t1.id)



I prefer this way, because:


it fast
it flexible - steps in-dependent and logic for UPDATE/INSERT could be
changed separately