UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yHWlu+aqRfnHmvuR8fYiFkYyWe43BvOtsPw7VWj41Dg='
WHERE
key_id = 'cc2e7ab98aae550d15c9d9900696111c590f604b9d4a566a94aa262226f55d3a'
AND (
token = 'yHWlu+aqRfnHmvuR8fYiFkYyWe43BvOtsPw7VWj41Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)