UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ROvpJ4VrnbWQ1/R0Ev6JTN4iamtzu8um8jNXpUAvWE=' 
WHERE 
  key_id = 'd292dcbca620b31d5c0029e75fe652f694ec30071739e11192b0cf1608380e2b' 
  AND (
    token = '0ROvpJ4VrnbWQ1/R0Ev6JTN4iamtzu8um8jNXpUAvWE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030