In an alleged post-racist world, you may sometimes hear someone sling out this age old phrase. Unfortunately it's often used by people seemingly to legitimise their somewhat racist views without feeling too guilty, or as some kind of black culture fetish. It's no doubt we as white people (and actually most other races) find black culture 'cool' and 'alluring'. From jazz, to jerk chicken, the civil rights movement, patois, twerking and of course the global domination of hip-hop that has influenced culture far beyond it's origins on the streets of the New York. It's no surprise then that people who want to appear cool would try and befriend black people. Unfortunately, if you befriend someone solely on the basis of their race in order to score 'cool points' or even 'woke points', then that itself constitutes as racism in a more abstract sense of the word. It's still treating someone like an accessory to yourself rather than as a individual. The Little Britain sketch, 'Black Friends', actually captures this in a perfectly awkward, profound way; by shinning a great big spotlight on the absurdity and uncomfortableness of racism in a 'post-racist' world.
Regardless, if someone's even gotten to the stage of having to defend themselves against accusations of racism, saying they have a black friend comes across as more of an excuse rather than anything else.