UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuAqZeAf4RLiDR/1N2TTjRFpzyyCG3gz8HZepsVXKj4='
WHERE
key_id = '9bbe0a9f57bc004278ade82d66cb6dbdc13878b72cf4ab3f971035458402bc85'
AND (
token = 'RuAqZeAf4RLiDR/1N2TTjRFpzyyCG3gz8HZepsVXKj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)