Once again, it depends on where you live and your individual circumstances. In some cases, the divorce decree takes precedence over the beneficiary designation. But not always.
State and federal laws can come into play in determining when a divorce decree does and does not trump the beneficiary designation. For example, many states have what is known as an "automatic revocation provision" once the divorce becomes final. In such situations, as soon as you divorce, your ex-spouse automatically becomes ineligible to receive the death benefit.
However, there also can be situations where federal law supersedes state laws. Consulting with an attorney is your best bet for determining which rules apply.