For the lowest ping times use flexible mode on the AP. This makes it impossible to do frequency reuse though, so take that into consideration.
With 2.5ms frames you should be seing much lower ping times than 40ms assuming this is the ping time between the cpe and ap. There may be interference or something else at play.
Please run spectrum analysis on both master and slave and share the results. The latency generally caused due to interference in the current channel.It could be self or external.