To solve the problem of poor real-time performance in path planning algorithms for unmanned aerial vehicles (UAVs) in low-altitude urban logistics, a path planning method combining modified Beetle Antennae Search (BAS) with the Simulated Annealing (SA) algorithm is proposed. Firstly, based on the requirements of task execution and constraints of UAV flight, a fitness function for real-time search of waypoints is designed while ensuring the safety and obstacle avoidance of the UAV. Then, to improve the search accuracy and real-time performance, determining the initial search direction in the BAS algorithm is improved, while the search step size and antennae sensing length are updated in real-time according to the distance between the UAV and the obstacle. Finally, the SA algorithm is combined with the BAS algorithm to update the waypoints, expanding the search range of each waypoint, avoiding the process of updating the waypoints from becoming trapped in the local optimal waypoints. Meanwhile, the effectiveness of the next waypoint is evaluated based on the Metropolis criterion. This paper generates a virtual urban logistics distribution environment based on the density and distribution of urban buildings, and compares the performance of algorithms in obstacle-sparse, obstacle-moderate, and obstacle-dense environments. The simulation results demonstrate that the improved method in this paper has a more significant capacity for environmental adaptation. In terms of the path length, waypoints, safety obstacle avoidance, and smoothness, the planned path outperforms the original BAS method. It satisfies the needs of real-time path planning for UAVs involved in urban low-altitude logistics.