UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PXB/1aCwlB95elmzg6teN+e2oRFiJbJx0SM5mIDr/zU=' 
WHERE 
  key_id = '4e31a720a6a064c4ea224d878cdda3d4ed9a1629403968ca5744830b1ad67ff1' 
  AND (
    token = 'PXB/1aCwlB95elmzg6teN+e2oRFiJbJx0SM5mIDr/zU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016