 Yes, there are various qualifications. The Apostle James suggests one. He wrote, He asked and received not because ye ask amiss. And then he explains why, saying, because ye think to consume it on your lusts. In more up-to-date language, James simply says that the prayers which go unanswered are selfish prayers.