I think this cannot be done in a single request, even if you use triggers because you get an error message:
CREATE TABLE cart_items (cart_id int key, quantity int); INSERT INTO cart_items VALUES (1, 1), (2, 2);
And now, if you run the update request:
UPDATE cart_items SET quantity = quantity - 1 WHERE cart_id = 1;
You will receive an error message:
ERROR 1442 (HY000): Can't update table 'cart_items' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
That is why I think you should use multiple queries ...
source share