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

Query time 0.00029