INSERT INTO tbl SELECT * FROM bar ON DUPLICATE KEY UPDATE baz = 1