UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SlDouA0EksrY/0ESTcXKxk4xKmOxBlNWzvTlOYkdPWs=' 
WHERE 
  key_id = 'f73def15741f3cf54814622b6b299d25af8ecfaed3f1635e483d59e8f0cd681a' 
  AND (
    token = 'SlDouA0EksrY/0ESTcXKxk4xKmOxBlNWzvTlOYkdPWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018