Ikke sikker på, at dette er meget effektivt, men det virker med kun én forespørgsel :
UPDATE t
JOIN (
SELECT MAX(t.id) AS maxid, lat, lon
FROM t
JOIN t AS duplicates
USING (lat, lon)
GROUP BY lat, lon
HAVING COUNT(*) > 1
) AS maxima USING (lat, lon)
SET flag = IF(id = maxid, 1, 2);