UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pGipWtQhJAab4+lGADRuOURgsp8KEacLLbTt381MHEM='
WHERE
key_id = 'b68c2966c261a78a2e26add1dfea421b66f1fcd6f7952b3ef4d4c36778a672c8'
AND (
token = 'pGipWtQhJAab4+lGADRuOURgsp8KEacLLbTt381MHEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)