UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFFpEhb4eIps+MhbcODuAgn7O6Q4JxVHFdYgcbg2EyY='
WHERE
key_id = 'fd54ed201096533ab88cba39481f22369aa1fc9fc340529e7d430c286e3220a8'
AND (
token = 'KFFpEhb4eIps+MhbcODuAgn7O6Q4JxVHFdYgcbg2EyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)