UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lt5PaOUCdFo1B3FDA/B69U3O4ZROd5ErOrhc0SQy+G4=' 
WHERE 
  key_id = 'e7e6e40aab8bf7bdd688981be876c0b4ba30ebecde981f1cda310c346cb2d229' 
  AND (
    token = 'Lt5PaOUCdFo1B3FDA/B69U3O4ZROd5ErOrhc0SQy+G4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038