If the CEO or other key executives are all demotivated and create a work environment that is not pleasant to be in then I would be looking for every opportunity to hit the door and find another company. Those individuals have the most to gain or lose depending on the success of the company and if they are not motivated to grow the business then you should find a team to work for that is driving hard to succeed every day.
Stay focused on your existing projects, do the very best you can in every activity you have with the company with your driving motivation to use the experiences and work product on your resume to find your next job move. If you are working with people in other companies let them know you are looking for a new position and use your current position to help find a job with a team that has their stuff together.
When just dealing with a middle manager that is hard to be motivated to work for, but overall you enjoy the company than focus on networking with other departments and make friends with people in other parts of the company, that is your best bet for being able to learn about possible openings for a lateral move. Again the same driving motivation for me in these situations is to excel and get noticed by others as someone that is reliable, does good work, and is in general nice to work with and new opportunities will likely present themselves and you can get out of the current demotivating situation.