UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iTIXz0bAvR/Vx8o8sJRQ6iYd9BAf2brsNuQJwA3dQKQ=' 
WHERE 
  key_id = '82c0c21ace5d7c7d23e14f0589ec3518c0ae272de6b9411a1e16495286f206fc' 
  AND (
    token = 'iTIXz0bAvR/Vx8o8sJRQ6iYd9BAf2brsNuQJwA3dQKQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047