Update multiple rows in 1 column in MySQL
you can use cases like below:
UPDATE example_table
SET variable1 = CASE id
WHEN 1 THEN 12
WHEN 2 THEN 42
WHEN 3 THEN 32
WHEN 4 THEN 51
END
WHERE id BETWEEN 1 AND 4
Not applicable to your example, but you probably will find this useful:
UPDATE table
SET value = <value>
WHERE field = <specific value>
This way you can update one field in a table on the basis of another field in the same table. All the applicable rows will be updated. To quote an example which I used at work earlier this morning
UPDATE porderitems
SET currency = -2
WHERE ord = 40396
This query update the porderitems table (purchase order lines), setting the currency to -2 for all the lines connected to purchase order 40396. The query neither knows nor cares how many lines there are in that purchase order; all of them will be updated.