Psalm 57
David hiding in a cave from Saul, among "lions." He shelters in the shadow of God's wings "until the danger has passed," which admits the danger is real and temporary. Then, still in the cave, he says his heart is steadfast and he'll "awaken the dawn" with music. Praise comes before the rescue.
"My heart is steadfast, O God, my heart is steadfast. I will sing and make music." (Psalm 57:7)