UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xc+KrA2AZhvHPhvXQmtXAFN0ceKh8fL34gKUKS0JK0A='
WHERE
key_id = '6a7e9b54be173b65ba7dbb4fb8735c77a2edd44d4822db3157651702bde1f448'
AND (
token = 'Xc+KrA2AZhvHPhvXQmtXAFN0ceKh8fL34gKUKS0JK0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)