The Prophet ﷺ said, "Do not come to the prayer rushing. Come to it walking calmly. Whatever you catch, pray it, and whatever you miss, complete it."
حدثنا ابن مهدي عن مالك عن العلاء بن عبد الرحمن عن أبيه
عن النبي ﷺ قال لا تأتوا الصلاة وأنتم تسعون وأتوها وعليكم السكينة فما أدركتم فصلوا وما فاتكم فأتموا
Its isnad is sahih. It appears in Muwatta 68-69, in a slightly longer form than this, through the narration of Malik from Ala bin Abdul-Rahman from his father, and from Ishaq bin Abdullah, both of them from Abu Hurairah. Muslim related it in 1:167, through the route of Ismail bin Jafar from Ala from his father from Abu Hurairah. Bukhari related it, in similar wording, in 2:97-98, through the route of Zuhri from Saeed bin Musayab, and from Abu Salama, both of them from Abu Hurairah. Muslim also related it through this route.