GitHub Actions: how to set a value conditionally

How to conditionally set a value in GitHub Actions:

env:
  TOKEN: github.event.inputs.env == 'dev' && secrets.DEV_TOKEN || secrets.PROD_TOKEN

If github.event.inputs.env == 'dev' evaluates as true, TOKEN will have value secrets.DEV_TOKEN; otherwise it will have value secrets.PROD_TOKEN.