"There is no secret. Obviously the fact that I was healthy during 20 years -- this is the reason why I was able to play 70 Grand Slams in a row," Lopez told reporters.
"I was taking care of my body. I was professional. I was trying to extend my career as much as I could, and I'm here... I'm so happy."
Khachanov, who advanced after downing a determined Kwon Soon-woo, has emerged as one of the torchbearers for the young brigade with the higher-ranked Alexander Zverev and Stefanos Tsitsipas crashing out in the opening round.
Although the Russian has beaten his next opponent in two previous meetings -- both on hardcourts -- Lopez can be at his best on grass.
The Spaniard warmed up for Wimbledon by claiming the singles title at Queen's Club before partnering the returning Andy Murray to seal the doubles title.
"It was obviously unexpected to be winning those titles in the same week. It was such a great effort and I'm so proud," Lopez added.
"This give me a lot of confidence. Might be another year playing tennis, probably."
In other matches, holder Novak Djokovic faces American Denis Kudla while Swiss Stan Wawrinka meets Reilly Opelka.
Former Australian Open champion Caroline Wozniacki plays Russia's Veronika Kudermetova while Simona Halep squares off against her Romanian compatriot Mihaela Buzarnescu.
(Reporting by Shrivathsa Sridhar in Bengaluru; editing by Clare Fallon)