In this paper, we propose an MPC-based motion planning algorithm, including a decision-making module, an obstacle-constraints generating module, and an MPC-based planning module. The designed decision module effectively distinguishes between structured and unstructured roads and processes them separately, so that the algorithm is more robust in different environments. Besides, the movement of obstacles is considered in the decision-making and obstacle constraints generating module. By processing obstacles with lateral and longitudinal speed separately, obstacle avoidance can be done in scenarios with moving obstacles, including moving obstacles crossing the road. Instead of treating the vehicle as a mass point, we explicitly consider the geometric constraints by modeling the vehicle as three intersecting circles when generating obstacle constraints. This ensures that the vehicle is collision-free in motion planning, especially when the vehicle turns. For non-convex obstacle constraints, we propose an algorithm that generates up to two alternative linear constraints to convexify the obstacle constraints for improving computational efficiency. In MPC, we consider the vehicle kino-dynamic constraints and two generated linear constraints. Therefore, the proposed method can achieve better real-time performance and can be applied to more complicated traffic scenarios with moving obstacles. Simulation results in three different scenarios show that motion planning can achieve satisfactory performance in both structured and unstructured roads with moving obstacles.