UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V4k7ExYiioi/KTW7OFqYjgVIDuHQYNFN3TACr9sxViU='
WHERE
key_id = '0976220abd012098ea11481bfc1fc10e64876f2d22b6d43a6c79acb84ef2e28a'
AND (
token = 'V4k7ExYiioi/KTW7OFqYjgVIDuHQYNFN3TACr9sxViU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)