To change the environment variables of a published Lambda function version, you must first change the current, unpublished function version ($LATEST). Then, publish a new function version.
Note: Consider creating a Lambda alias to point to a function version that's configured with the environment variables that you want to use. Using aliases allows you to avoid hard-coding a specific function version into your app.