UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZR3+VqD17KMQsUTAC4vQ7EkcZwRGE015LjZRnmCbxbA='
WHERE
key_id = '4a4b19c96b01741b080ad21f5cb762c9f51e5562710255af4a770c9efb68aecc'
AND (
token = 'ZR3+VqD17KMQsUTAC4vQ7EkcZwRGE015LjZRnmCbxbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)