UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z9Q7QYiXwwNJyqeLB25XNiRY4dtYeBesLpofWKsiCXs='
WHERE
key_id = 'ce5d03bee485af49ae2c3a4c29bb2689f7db8c4e0f7b0d65949c44ec9e04af11'
AND (
token = 'Z9Q7QYiXwwNJyqeLB25XNiRY4dtYeBesLpofWKsiCXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)