So, the U.S. would try to claim Mexico, hoping for a southern route to the Pacific instead of a Northern. Seems rather silly since they only had to negotiate peacefully with Britain to get the northern route.
More than likely, when the U.S. became warlike, Britain would step in and start enforcing its claims in Columbia, Oregon and Shasta[1] in order to avoid losing them. The U.S. would lose the war (see jycee's comments) and not get any route to the Pacific. They'd probably last as a nation, but the Civil War would be delayed and they definitely wouldn't become one of the 'Friendly Nations Up North'[2] whose exports helped Mexico build it's commercial trading success.
Mexico would keep all the gold in California (although obviously not the gold fields in Shasta, that would go to Britain), instead of just a portion of it -- although I can't resist mentioning that the Mariposa 'War'[3] would be butterflied away. But the extra gold's not necessary a good thing. Mexico might grow to become a world power much faster, or their economy would fly high and then crash and burn, and the entire northwestern half of Mexico would shatter into petty dictatorships like Tejas, Rio Grande, Coahuila and Nuevo Leon did. Probably followed close after by a large portion of the southeastern Mexico -- although if the Mexico City can use that gold to hold on the Yucatan, maybe not.
[1] The northwest coast is divided into four states: California (known internationally as Anglo-California) to the 40th Parallel, Shasta to the 43rd, Oregon to the Columbia River and Columbia above that.
[2] Other nations in this group include Canada, Manitoba and British Columbia.
[3] A bloodless confrontation in which U.S. gold prospectors attempted to push their claims into the Mexican state of Mariposa[4], until the U.S. government stepped in to avoid an international incident.
[4] Formed by Mexico out of a portion of northern California in an effort to manage their portion of the gold rush. Translates into English as 'Butterfly'.