23 Jesus was going through the grain fields on a Sabbath, and his disciples began to pick some heads of wheat as they made their way. 24 So the Pharisees said to him, “Look, why are they doing what is against the law on the Sabbath?” 25 He said to them, “Have you never read what David did when he was in need and he and his companions were hungry— 26 how he entered the house of God when Abiathar was high priest and ate the sacred bread, which is against the law for any but the priests to eat, and also gave it to his companions?” 27 Then he said to them, “The Sabbath was made for people, not people for the Sabbath. 28 For this reason the Son of Man is lord even of the Sabbath.”
Yoma 85bBabylonian Talmud
Other tanna’im debated this same issue. Rabbi Yosei, son of Rabbi Yehuda, says that it is stated: “But keep my Shabbatot” (Exodus 31:13). One might have thought that this applies to everyone in all circumstances; therefore, the verse states “but,” a term that restricts and qualifies. It implies that there are circumstances where one must keep Shabbat and circumstances where one must desecrate it, i.e., to save a life. Rabbi Yonatan ben Yosef says that it is stated: “For it is sacred to you” (Exodus 31:14). This implies that Shabbat is given into your hands, and you are not given to it to die on account of Shabbat.
Notes and References
"... Sigal draws our attention to the parallel saying attributed to Rabbi Simon ben Menasya, who said: "Behold, it says: 'And you shall keep the sabbath, for it is holy unto you' [Exodus 31:14]. This means: The sabbath is given to you but you are not surrendered to the sabbath" (Mekilta on Exodus 31:12-17). Sigal reasons that since this parallel is too close to be regarded as nothing more than a coincidence, and since Jesus, who antedates Simon ben Menasya by more than 200 years, is the first to have articulated this halakah, it is most likely that what is credited to Menasya originated with Jesus. Sigal suspects that in other areas, such as in his stricter views of personal piety and more lenient views of cultic requirements, Jesus influenced Tannaic Judaism ..."
Evans, Craig A. Ancient Texts for New Testament Studies: A Guide to the Background Literature (pp. 252-253) Hendrickson Publishers, 2005