The road is signed probably for 30 because that's what is was historically or that's what they got after evaluating what the confusing web of rules and regulations says it should be.
The lights are set up for 40-50 because the person responsible for tuning the light a) looked at existing traffic data and set the light to that or b) assessed the properties of the road using totally different measures and determined that's the speed traffic would go.
And the city doesn't change the sign to reflect the reality of the traffic because a) they'd have to re-navigate the web of rules to do that and b) shirking potential revenue is a fast track to a dead end job for bureaucrats in that state c) doing nothing is easy.
Unless the road is determined to be a local road, posted speed limits are only enforcable if set by an engineering survey, or if it's at least X, which I think is 60 or 65. But I'm not sure it's illegal to post an unenforcable speed limit, or to ticket against it, it's just that those contesting the ticket will win.