The stock market's CAPE ratio has crossed 30 for only the sixth time in 155 years. What history says about crashes, valuations, rates and the AI boom.