Digital twin (DT) technology is used to optimize sustainable farming through IoT and artificial intelligence (AI). The existing literature on the subject remains divided on the integration of systems and their effects. The outcomes of the review suggest that modular and microservice-based frameworks are the most popular because they are not addressed individually as frameworks for conceptual backgrounds, algorithms, and performance indicators of agricultural DT systems. The AI methodology is trending towards purely data-driven models, followed by hybrid models that incorporate physics-inspired approaches to account for environmental variability. In reported case-study evidence, DT implementation was associated with context-specific sustainability benefits, including a 15-20 percent increase in farm productivity and a 25 percent reduction in resource consumption. However, these reported gains are constrained by high infrastructure costs, limited interoperability, and data-security risks, which remain major adoption challenges. In the future, research should focus on scalable, cost-effective platforms and longitudinal validation to reduce the gap between prototype success and equitable, large-scale use in sustainable agriculture. This study supports the United Nations sustainable development goals (SDGs): SDG 2 (Zero Hunger), SDG 12 (Responsible Consumption and Production), and SDG 13 (Climate Action) by advancing data-driven and resource-efficient digital twin frameworks for sustainable agriculture.