UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5/YIdI2ggoIbDsKWGjpa6LJOgQtfCAntOpOTXFodp4='
WHERE
key_id = '6c2cb978f6277ba8ecbba6930c6de0274e891f8c35c0c8260f358ebd32b342c5'
AND (
token = 'W5/YIdI2ggoIbDsKWGjpa6LJOgQtfCAntOpOTXFodp4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)