In 2015 and 2016, 58% of second-time MCAT takers who scored in the 514-517 range received a higher score on the second try. That means 42% of them got the same score or a worse score. (10% of re-takers in this group actually ended up getting a second score that was 4+ points worse than their original one.)
You probably have solid analytical skills if you got a 517 on the MCAT, so decide for yourself whether re-taking would be a worthwhile gamble.