UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+M2DjJkgiLoU+whODXHhlZLI+rD1oEpdGu1W8IAkQd0='
WHERE
key_id = 'c999128fd430ad8849efa73b9bdcb6bf4d6baa06958308ceacf9c4ef517460e9'
AND (
token = '+M2DjJkgiLoU+whODXHhlZLI+rD1oEpdGu1W8IAkQd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)