One way to do this is using the anti-join pattern, e.g.
UPDATE player_items p
LEFT
JOIN ( SELECT uid
FROM player_items
WHERE slot = 12
AND uid = 2
LIMIT 1
) q
ON q.uid = p.uid
SET p.slot = 20
WHERE p.id = 0
AND p.uid = 2
AND q.uid IS NULL
The LEFT JOIN looks for a matching row, but if no matching row is found then MySQL will generate a row with all NULL values. We can filter out any rows that matched using the q.uid IS NULL predicate, so we will only get rows where there was no match.
mysql> UPDATE player_items p
-> LEFT
-> JOIN ( SELECT uid
-> FROM player_items
-> WHERE slot = 12
-> AND uid = 2
-> LIMIT 1
-> ) q
-> ON q.uid = p.uid
-> SET p.slot = 20
-> WHERE p.id = 0
-> AND p.uid = 2
-> AND q.uid IS NULL
-> ;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0