First, let's put things in perspective. 510 is right in the middle of the curve, which is not a bad place to start from. While everyone wants that perfect score, remember that the GMAT is just one part of a broader application profile. Sure, it matters, but probably not as much as you've built it up in your head. Moral: Depression isn't warranted, and will work against you in the long run.
Now, onto the GMAT. You didn't describe your prep, so I am going to assume it was self study. Self-prep is important in any prep process, but it has diminishing returns, because it can be difficult to "get out of your own head". In the same way a batter can't see the problem with their swing, most GMAT-ers require at least some coaching in the form of a class, tutoring, or even a friend with a strong score.
The good news is that going from 510 to 650 is entirely feasible. You most likely have many of the fundamentals covered, which provides a good basis for guided study. Additionally, good prep takes time; six week is not enough to allow the full extent of what you should be learning to absorb into your working memory/problem solving vocabulary and express itself on the exam. Many people rush, but that just makes the time they spend less efficient. 2-4 months is a reasonable prep time, depending on the goals. 510-640 represents a sizeable jump in percentile, so I would advocate toward giving yourself more time rather than less.
The good news is that you should have plenty of time until first round admissions. So sit back, chart out a plan, and be confident that you can get there as long as you provide yourself a good teacher, allow yourself adequate prep time, and develop a strong, flexible plan to get yourself there.
Ben