The 23-year-old Rouen and Madrid champion extended her winning streak on clay this season to 12 matches with her 6-2 6-3 win over Selekhmeteva, who was born in Russia but switched allegiance to Spain ahead of this tournament.
But the 15th seed said the result was overshadowed by news of a missile strike near her parents' home in Ukraine earlier on Sunday.
Kyiv and surrounding areas were hit with hundreds of drones and missiles in one of the heaviest bombardments of the Ukrainian capital since Russia's invasion four years ago.
"I'm incredibly proud of myself today," an emotional Kostyuk said during her on-court interview.
"I think it was one of the most difficult matches of my career. This morning, 100 metres away from my parents' house, a missile destroyed a building. It was a very difficult morning for me.
"I didn't know how this match would turn out. I didn't know how I'd handle it. I don't want to talk about myself today. I'm very pleased to be in the second round, but all of my thoughts and my heart goes to the people of Ukraine today."
Kostyuk, who has been one of the most vocal opponents of the war, said it was important for her to keep going.
"My biggest example is Ukrainian people," she added.
"I woke up in the morning and I looked at all these people who woke up and kept living their lives, kept helping people who are in need. I knew a lot of Ukrainian flags would be here, and a lot of Ukrainian people would come out and support.
"My friends from Ukraine came as well. Very happy to have them here."
Kostyuk faces Katie Volynets or Clara Burel next.