UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FLlxv8IaW/sBNl4MyhbrMsLIlMwxD2p97Ie3tkw8qj4='
WHERE
key_id = 'bbd76e619d6ed72c0b6edd38dd1dfb31438bc00cca18ea422821036f60662e9a'
AND (
token = 'FLlxv8IaW/sBNl4MyhbrMsLIlMwxD2p97Ie3tkw8qj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)