UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QNPbRCRR6qpa/68ZH6Rksae/Ha8DUTWODkUKtynEyIc='
WHERE
key_id = 'a76960fdfc3a1ee1b8bd4e53179a60cdf3038f96acc08906e2eda6111b3f83f3'
AND (
token = 'QNPbRCRR6qpa/68ZH6Rksae/Ha8DUTWODkUKtynEyIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)