“and the years of your life will be many.” This is one of the many “ideal” promises in the Word of God which would be fulfilled here on earth today if we lived in a godly world with godly people. We do not, and so there are people who obey God and their parents but who do not live long lives for any of a number of reasons: accidents, disease, crime, and more. This promise will only be fully fulfilled in the future.
[For more on promises like this, see commentary on Prov. 19:5.]