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