UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+XpP+C2NorT33/Q5NffmaFM4g3AYHiXNfuxU3zIy1k=' 
WHERE 
  key_id = 'd8843ca729555359fc84040696a661edacf03e2b363fbb6cd533f1ab4b267eef' 
  AND (
    token = '3+XpP+C2NorT33/Q5NffmaFM4g3AYHiXNfuxU3zIy1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071