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