The associated production of a Higgs boson and a top-quark pair is measured in events characterised by the presence of one or two electrons or muons. The Higgs boson decay into a b-quark pair is used. The analysed data, corresponding to an integrated luminosity of 139 fb(-1), were collected in proton-proton collisions at the Large Hadron Collider between 2015 and 2018 at a centre-of-mass energy of A root s = 13 TeV. The measured signal strength, defined as the ratio of the measured signal yield to that predicted by the Standard Model, is 0.35(-0.34)(+0.36). This result is compatible with the Standard Model prediction and corresponds to an observed (expected) significance of 1.0 (2.7) standard deviations. The signal strength is also measured differentially in bins of the Higgs boson transverse momentum in the simplified template cross-section framework, including a bin for specially selected boosted Higgs bosons with transverse momentum above 300 GeV.