We estimate the cosmological variation of the proton-to-electron mass ratio mu=m_p/m_e by measuring the wavelengths of molecular hydrogen transitions in the early universe. The analysis is performed using high spectral resolution observations (FWHM ~ 7 km/s) of two damped Lyman-alpha systems at z_{abs}=2.3377 and 3.0249 observed along the lines of sight to the quasars Q 1232+082 and Q 0347-382 respectively. The most conservative result of the analysis is a possible variation of mu over the last ~ 10 Gyrs, with an amplitude Deltamu/mu = (5.7+-3.8)x10^{-5}. The result is significant at the 1.5sigma level only and should be confirmed by further observations. This is the most stringent estimate of a possible cosmological variation of mu obtained up to now.