how can i upgrade the foreman 1.23.1 to 1.24 ?
yes, you can upgrade.
Just follow the upgrade instructions from the manual and you should be fine.
I assume you run Foreman without Katello. If you are using Katello, use their instructions instead.
If you encounter any problems on the way, feel free to ask.