UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ho0xZ+QyHtIoW4recBQ1wwoUmbWj2a4cBUPAOV8H2gg=' 
WHERE 
  key_id = 'ced1e0f25be2829e47c29551965a5258a10743715674991d4804539fc02b996d' 
  AND (
    token = 'Ho0xZ+QyHtIoW4recBQ1wwoUmbWj2a4cBUPAOV8H2gg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029