Old Testament readings use the Septuagint , the Scripture the apostles quoted. Masoretic numbering shown for reference.Learn why
KJV

Psalms 40:7

Then said I, Lo, I come: in the volume of the book it is written of me,

Read in other translations