You should invest in both.
As for MySQL, if you are using InnoDB as your default storage engine, you must upgrade to MySQL 5.5 in order to use more cores. Here are some of my past posts on this subject
As a point of reference, I have a client at my employer's web hosting company that has three DB Servers in Circular Replication. Each DB server has the following:
- MySQL 5.5.9
- 192 GB RAM
- 162 GB InnoDB Buffer Pool
- dual hexacore (that's right, 12 CPUs)
- 1.8TB Disk Volume
- 978 multitenant databases
- 892 GB of InnoDB Data
- innodb_file_per_table enabled
They have had this setup for a whole year. I personally configured my.cnf for multicore engagement. All 12 CPUs are in use. The InnoDB Buffer Pool is full to capacity. There have been no complaints from the client on the DB Performance since this layout was setup for them.
Tuning InnoDB is very important because if you don't, MySQL 5.5 will perform worse than MySQL 5.1. In some cases, it can be worse than MySQL 4.1.
As for RAM, tuning connection usage, the number of connections and InnoDB caches is the most important thing