UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FzCTh9hHTGXNlU1SnbGZIpoy2TfAOjfBjJTwmsjMiFI='
WHERE
key_id = 'f8f0ec5132244e8403d254a651772fb5adf4c437b8eb358ae95902a513f1c5fa'
AND (
token = 'FzCTh9hHTGXNlU1SnbGZIpoy2TfAOjfBjJTwmsjMiFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)