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

Query time 0.00022