A model of thermal quench in tokamaks is proposed, which presumes that the duration of energy release on the walls (thermal quench) is defined by the outflow of plasma from the core. The motion of plasma in the SOL at the stage of thermal quench is regulated by the same processes of anomalous transport which exist in steady-state modes. An approximate formula is derived, which relates the duration of thermal quench to the parameters of facilities and to the characteristics of plasma. The obtained results are compared with experimental data.