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