UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ligKPvBDccLg8c/LKOszk6T9JGbfZOIS8LlhdaBSv4=' 
WHERE 
  key_id = '93f54f11386dee37de5c63587c888d0ede2e4b8d73a56a09cb40910174d178eb' 
  AND (
    token = '7ligKPvBDccLg8c/LKOszk6T9JGbfZOIS8LlhdaBSv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025