Well, this is old. But of course you only need to provide a value once, there's no reason to add it a second time in the query (which comes in handy for multiple inserts, or prepared statements):
INSERT INTO table1
(col1, col2, col3, col4)
VALUES
('val1', 'val2', 'val3', 'val4')
ON DUPLICATE KEY UPDATE
col2=VALUES(col2),
col3=VALUES(col3) [,...]
Which has as advantage it will still work for a multiple insert statement:
INSERT INTO table1
(col1, col2, col3, col4)
VALUES
('val1', 'val2', 'val3', 'val4'),
('val5', 'val6', 'val7', 'val8'),
('val9', 'val10', 'val11', 'val12')
ON DUPLICATE KEY UPDATE
col2=VALUES(col2),
col3=VALUES(col3) [,...]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…