please look at the image , you will find mysql CASE WHEN executed even condition is false
_skus
sku_id is_available is_quantity quantity
13 1 0 NUll
UPDATE _skus SET is_available =CASE WHEN is_quantity = 1 and quantity=0 THEN 0 END where sku_id=13
after mysql statement executed
sku_id is_available is_quantity quantity
13 0 0 NUll
is_available updated to 0 even the condition not true