You MAY want to install SP1 if this is for Exchange. It sounds like this bug was fixed in that.
I'm not really sure on the CORRECT answer to your question, however, you may simply be able to change the syntax of the SQL query to this:
At this numerical prompt: 1> type the following command: update ServerConfig set ExternalServicesPort=3201 where ServiceName='VirtualBESServerName' and press Enter.
Again, this may or may not work. This is the same command for 3.x changed to the correct table and values for 4.0. Just as a disclaimer, I would not attempt this myself on my database (personally speaking) without speaking to RIM first. There are only two places in the 4.0 database where 3200 exists and that is the table above (ServerConfig) and GlobalSettings (under column - 'NextExternalServicesPort').
Hope that may help.