All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
Swallowing phlegm or mucus during the prayer invalidates it if it is possible to spit it out. The Maaliki scholar Al-Hattaab said, "Whoever swallows phlegm during the prayer while he is able to spit it out, his prayer is invalidated, and his fast too if he is fasting." [Mawaahib Al-Jaleel]
The Shaafi'i scholar Al-Khateeb Ash-Shirbeeni said about the invalidators of prayer, "and swallowing phlegm that came down from his head if he was able to spit it out but did not do so." [Al-Iqnaa‘ fi Hall Alfaath Abi Shujaa‘]
As for blowing air from one's mouth and the like, if it leads to articulating two letters, it invalidates the prayer. The Shaafi‘i book Al-Bayaan reads, "If he clears his throat noisily, groans, breathes noisily, or blows air during the prayer and two letters are articulated – such as saying aah, waah, uff – it invalidates the prayer because this is considered speaking. If two letters are not articulated – such as saying an extended fffffff – his prayer is not invalidated..."
Ash-Sheeraazi said, "If he clears his throat noisily, breathes noisily, blows air, cries, or laughs deliberately and two letters are not articulated, his prayer is not invalidated." [Al-Muhaththab]
Allah knows best.