Background: Chronic kidney disease (CKD) is getting more common in elderly people with metabolic syndrome, but early detection and risk prediction are still hard. So we created and validated a CKD risk prediction model tailored for these patients to get past the limits of existing clinical screening tools. Methods: We used data from the National Health and Nutrition Examination Survey and the China Health and Retirement Longitudinal Study to develop and validate the CKD prediction model. We defined CKD based on an estimated glomerular filtration rate < 60 mL/min/1.73 m2, calculated with the chronic kidney disease epidemiology collaboration (CKD-EPI) formula. We did feature selection with a mix of strict methods and evaluated model performance across both internal and external validation cohorts. We used 10 machine learning algorithms and four data balancing strategies. The final CKD prediction model had strong predictive power and clinical interpretability for early detection of prevalent CKD. Results: The final model, which uses four key variables (uric acid to high-density lipoprotein cholesterol ratio (UHR), age, uric acid, blood urea nitrogen (BUN)), had predictive accuracies of 0.864 (internal) and 0.831 (external) when using logistic regression. This shows it is robust and can be applied widely. Shapley Additive exPlanations analysis and restricted cubic spline analysis found significant links between the key features and CKD risk. Conclusion: This study developed a reliable, interpretable CKD risk prediction model using routine clinical indicators. It gives an effective tool for large-scale early CKD screening and stratified management in primary care and has high clinical applicability.