Question:Was the Law of Moses in effect while Melchizedek lived?
Melchizedek was a contemporary of Abraham (Genesis 14:17-24). Moses was a descendent of Abraham who lived about 500 years after Abraham died. Therefore it would be impossible for someone to live under a law that was not given until hundreds of years later.
It is not that these people were without a law, it just was that they did not live under the law of Moses. The law of Moses was for the Israelites. When Moses discussed the law with the Israelites, he specifically stated that it did not exist for their ancestors. "The LORD did not make this covenant with our fathers, but with us, those who are here today, all of us who are alive" (Deuteronomy 5:3). However, Paul pointed out that sin was in the world prior to Moses and sin cannot exist without a law being in existence. "For until the law sin was in the world, but sin is not imputed when there is no law. Nevertheless death reigned from Adam to Moses, even over those who had not sinned according to the likeness of the transgression of Adam, who is a type of Him who was to come" (Romans 5:13-14). The implication is that they had a form of law to follow, just not the formal law of Moses.
We generally call this period from Adam to Moses the Patriarchal Age. It was the time when the head of each family offered up worship to God. When the Law of Moses came into being, one nation was given a special covenant to follow while the rest of the world remained under the Patriarchal rules. "For when Gentiles, who do not have the law, by nature do the things in the law, these, although not having the law, are a law to themselves, who show the work of the law written in their hearts, their conscience also bearing witness, and between themselves their thoughts accusing or else excusing them" (Romans 2:14-15). When Christ came, the distinction made by the Law of Moses was removed and all the world is now under one covenant. "For He Himself is our peace, who has made both one, and has broken down the middle wall of separation, having abolished in His flesh the enmity, that is, the law of commandments contained in ordinances, so as to create in Himself one new man from the two, thus making peace" (Ephesians 2:14-15).