UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ef2fo/rynF7HKBlqh0Pi2XVoMPDjBCzJCyca+eRkGic=' 
WHERE 
  key_id = '08ed8666075602976b862d0107b7fccdaec8ed43318ac400740c29eef21a3076' 
  AND (
    token = 'Ef2fo/rynF7HKBlqh0Pi2XVoMPDjBCzJCyca+eRkGic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032