The paper investigates the stationary and non-stationary cooling processes of high-viscosity crude oil temperature in the Severnye Buzachi – Karazhanbas pipeline during both pump operations and pump shutdowns. To transport high-viscosity crude oil through pipelines, the hot pumping method is employed. During oil transportation and pump shutdowns, the oil temperature decreases due to heat exchange with the environment, leading to an increase in oil viscosity. As viscosity rises, more power is required from the pumps to move the thickened oil, resulting in higher electricity consumption. To avoid increased operational costs after pump shutdowns, it is crucial to accurately calculate the oil cooling temperature in order to determine the safe shutdown duration and a critical temperature threshold. The Shukhov formula is used to calculate oil temperature during transportation, while a modified version is applied during pump shutdowns. To verify the accuracy of the obtained oil temperature results, the calculated values were compared with the measured values from pipeline sensors in both stationary and non-stationary cases. The novelty of the work is in determining the methodology for calculating the safe shutdown time of a pipeline for high-viscosity oil. The proposed formula was validated using experimental data from SCADA system sensors in real-time.