Sed

# Replace value in key=value config (matches key = value, key.something=value, key.something = value)

$ sed -e 's/^\([kK][eE][yY].*=\s*\).*$/\1NEW_VALUE/' filename.ext |or| sed -e '/^[kK][eE][yY].*=/ s/=.*/=NEW_VALUE/' filename.ext