UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LniTfNwTzYxpNZQb0rYKzOWQe12d7VFlhMwlk1nP8g4='
WHERE
key_id = '1e26c4d6d4c921be54e85256dedf648a4d54dc1880d898023b8f1ef2c80ad90d'
AND (
token = 'LniTfNwTzYxpNZQb0rYKzOWQe12d7VFlhMwlk1nP8g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)