UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ByNLrZIZSeYCSJKluVEBrb9Ra9UJPwoWRSNVYp9PkSU='
WHERE
key_id = '9400ce1d1e7eedde0d154d0cdc9defcf7fe3c86e8261101982b425199fa145c5'
AND (
token = 'ByNLrZIZSeYCSJKluVEBrb9Ra9UJPwoWRSNVYp9PkSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)