Optimize MySQL insertion - insert multiple records with condition (per record)
IODKU works well with SELECT:
INSERT INTO t
    (unique_key, counter, time)
    ON DUPLICATE KEY UPDATE
        counter = VALUES(counter) + 1,
        time = NOW()
  SELECT unique_key, 1, NOW()
      FROM ...

Notes:

Need unique key (or set of columns)
See how a counter can be updated