UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSvXAhRyVt0mosGO6SLUSA7HOMuZnG3qpdV0ovINim4='
WHERE
key_id = '3f3528e7d11cbd1ed2381cbb4c52720e9dd2ae53d8501dc0b96c749901b7d3fe'
AND (
token = 'HSvXAhRyVt0mosGO6SLUSA7HOMuZnG3qpdV0ovINim4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)