START TRANSACTION;
update product set t1="t1" where p_id=40717;
update product set t1="3" where p_id=40713;
.....
commit;
WITH updates(t1_filter,value) AS (
SELECT 't1', 40717
UNION SELECT '3', 40713
)
UPDATE product SET p_id = updates.value
FROM product
INNER JOIN updates ON updates.t1_filter = product.t1
I have used a WITH statement here, but you could write your updates to another table and use a similar syntax for the UPDATE statement (Update one table based on data that is in another table). This will be quicker than individual update statements.
UPDATE product SET t1='A' WHERE Id=1;UPDATE product SET t1='B' WHERE Id=2;UPDATE product SET t1='C' WHERE Id=3;
By this, you can make the single statement and execute that.