Example:
$query = "update tabela set coluna1 = 1 where id = {$id_m} union
update tabela set coluna2 = 1 where id = {$id_v}";
Example:
$query = "update tabela set coluna1 = 1 where id = {$id_m} union
update tabela set coluna2 = 1 where id = {$id_v}";
UNION is used to combine the result from multiple SELECT statements into a single result set. link
At first it is used only in SELECT.