UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i2Oqm/S9O6MwbdXpYPAEGzIXdCAXZRffluVAgKJ+kxU=' 
WHERE 
  key_id = 'e2f2ab4da5a97e41cbf1c28dc4e38e06f40161aa1fe917497aa8d235058f70f6' 
  AND (
    token = 'i2Oqm/S9O6MwbdXpYPAEGzIXdCAXZRffluVAgKJ+kxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047