If you know what x is you can include that in the pattern: sed 's/aaaa=x/aaaa=Y/' file
If x is not known but you do know it is not a number (first entry has a number): sed 's/aaaa=[a-z]/aaaa=Y/' file
If you know that the second pattern is after a certain line number: sed '4,$s/aaaa=.*/aaaa=Y/'
You need to look for a uniqueness (examples 1 and 2) or a safe range (example 3).
Hope this helps.