UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xosMflR4UMJxZc41DgIsio3ueXAceovOFW1nI2UbdN0='
WHERE
key_id = '14fb28a803518bdaaa28a064e7060373445f6ebae1f537506d1b93738279aa9f'
AND (
token = 'xosMflR4UMJxZc41DgIsio3ueXAceovOFW1nI2UbdN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)