UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8R1uEReb3U6xGlD09YOZML9K1dOGnf1GHyXpc9lJsU='
WHERE
key_id = '7fcba893a924ceb20beb62e2fa3b1e2b32c0f9bc481427f4ddf0a52163419782'
AND (
token = 'b8R1uEReb3U6xGlD09YOZML9K1dOGnf1GHyXpc9lJsU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)