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 is His slave and Messenger.
The mere licking of the lips, even if they are wet with saliva or moist, does not break the fast; rather, what breaks the fast is to intentionally bring the saliva out of the mouth and into it again and then swallow it. So if one deliberately brings out the saliva to the outside of the lips and then swallows it, his fast is broken by doing so.
In case where swallowing the saliva breaks the fast, it invalidates the prayer as well if it is done during the prayer because it is similar to eating and drinking intentionally, as stated by many scholars of Fiqh.
Allah knows best.