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

Query time 0.00018