Marlon King put in a man of the match performance as Birmingham came from behind to beat Middlesbrough 3-2 at St Andrew's.