Q: When is the earliest usage of 'woke' and 'wokeness' in their meaning of awareness of social injustice? The new usage of 'woke' (being alert to issues of social justice) and 'wokeness' appears to be becoming widespread. 
Merriam Webster states:

Woke's transformation into a byword of social awareness likely started in 2008, with the release of Erykah Badu's song "Master Teacher":

"To keep a healthy life, I stay woke."
Is there an earlier example of the usage of these two words ?

[EDIT : subsequent to Laurel's answer I did an Ngram of 'stay woke' in AmE.
Big blip in 1880 (interesting) and then, in line with Laurel's findings,
usage begins 1960/1980s to present.]


A: Its earliest written usage appears to be from a glossary of terms published  by the  NY Times magazine in 1962, implying that its usage was by then already somewhat established and that its original usage probably dates a few years earlier: 

Woke follows a long history of words and phrases that relate the gaining of knowledge to sleep and/or sight.  Everyone from angry politicians to conspiracy theorists has told the world they're 'blind to the truth' or that they need to 'open their eyes', and rap music with a political message is widely known as 'conscious' hip-hop. 'Woke' is a natural successor to these, but its grammatical quirk is a product of AAVE (African-American Vernacular English) which through the ambiguity of its tense, implies being woke is a state of mind rooted in the past. The implication is that once someone has become woke, they can't easily go back to sleep. For instance, people describe themselves as 'being woke' as opposed to 'being awake' or having 'woke up'.
Like most words, the history of woke is a surprisingly long one. The word was first used in the 1800s but back then, it only meant the act of not being asleep. Fast forward a few centuries and the first recorded use of 'woke' in its politically conscious incarnation was via a N.Y. Times Magazine glossary of 'phrases and words you might hear today in Harlem' in 1962. 
The glossary was alongside an article on African-American street slang by black novelist William Melvin Kelley, and his explanation of 'woke' was the 'well-informed, up-to-date' definition the OED uses today. In 1972, Barry Beckham's play Garvey Lives! includes a character claiming he'll 'stay woke' using the work of Jamaican activist leader Marcus Garvey: 'I been sleeping all my life. And now that Mr. Garvey done woke me up, I'm gon stay woke. And I'm gon' help him wake up other black folk'.

(thedebrief.co.uk)
Also wokeness has a very old origin. Its current usage is much more recent: 

It turns out that wokeness is a very old word in our language, the earliest written documentation dating from around the year 1000 (the Oxford English Dictionary cites the Homilies of Ælfric).
The medieval usage wokeness (also spelled wacnys or wacnysse) is akin to our modern weakness, and means either debility or inferiority.
We seem to have stopped talking about our bodily wokeness/wakenes sometime in the 16th century.
The modern, urgent use of wokeness turns the original usage on its head. Not weakness but the strength that comes from awareness, not intrinsic inferiority but maybe the humility that derives from knowing how privilege and prejudice have benefited those of us who have benefited, and how the same privilege and prejudice have damaged or destroyed others.

(www.chronicle.com)

A: In her new book, A World without "Whom" — The Essential Guide to Language in the BuzzFeed Age (Bloomsbury USA, 2017), Emmy J. Favilla writes this about the term woke (pp. 204-206):

...one byproduct of communication in the digital era is that phrases once circulated primarily within a particular community or group often find themselves gliding rapidly into mainstream usage, shape-shifting in the process. In this age of the omnipresent hashtag, spotting an unfamiliar word traipsing around the internet and misappropriating it by assigning it the characteristics you think it reflects—or applying it in a manner that is most familiar to you—is one way this happens... Sometimes, a major media event thrusts a word into the mainstream and that word shortly thereafter takes on a more nuanced meaning in other circles, as in woke.
Being "woke" is a sentiment that picked up momentum in the mid-2010s in mainstream culture. A derivative of "stay awake," it has strong associations with race and social injustice, and it's an adage central to the Black Lives Matter movement. It means, essentially, to have a heightened awareness—of situations that may not accurately reflect the truth, or situations you may not have firsthand experience living through, or things you may not wholly understand but want to make an active effort to—and to realize that one person's experience of reality is not necessarily reality as it exists for the rest of the world. As old standby Urban Dictionary defines it, to "stake woke" is to "keep informed of the shitstorm going on around you in times of turmoil and conflict, specifically on occasions when the media is being heavily filtered..."
As with many modern slang terms with origins in black culture, being woke has been appropriated by the wider population and trickled into the mainstream dialogue...
While woke is still prevailingly used to connote an awareness and an acknowledgment of how privilege (whether white, male, heterosexual, or otherwise) functions in our world, and signifies a state of being educated, compassionate, and supportive of basic human rights, it's also progressed to stand-in for "Be aware of this truth" or "Here's what you should know."

To answer your question, I do not believe it is a mainstream term. I do see it on some websites, and so I need to understand what it means, but I wouldn't use the term myself. To me it would feel like cultural appropriation.
P.S. I would recommend Ms. Favilla's book. I'm older and tend to be prescriptivist-leaning (as she might call me), and her book is helping me understand modern grammatical constructions like "because + noun." As in, I can't seem to lose weight, because bread. Plus I'm finding it an entertaining read.

A: I'm going to say it's not mainstream yet. Wokeness is not in most dictionaries. Woke is in several, but is clearly marked as informal or slang pretty much every time:


*

*ODO 


*

*Woke: "informal"

*Wokeness: no entry


*Collins


*

*Woke: "informal"

*Wokeness: no entry


*MW


*

*Woke: "slang"

*Wokeness: no entry


*Wiktionary


*

*Woke: "slang"

*Wokeness: "slang"



When it comes to books, wokeness is only found in seven results. Only a few more hits show up in Google Scholar, which searches scholarly articles. 
It's a bit harder to assess the number of hits for "woke" in this sense as a simple search will return many results for wake's past tense. Thus I decided to search for "stay woke", which is a common collocation. There are more results in both the Google Books and the Google Scholar searches, but still not a lot. It's not a perfect search; some of the hits are false positives and some only are hits because they reference something with "stay woke" in the title.
All of this, combined with the fact that these terms are often defined and/or "in quotes" whenever they are used, indicates to me that these words are not yet mainstream. Woke is, however, significantly more popular than when it was first used in this sense in 1962.

A: An interesting antecedent to the social justice sense of woke appears in Shane Stevens, Go Down Dead (1967) [combined snippets]:

He get up slow and he float into the kitchen when he come back he got three in his hand. He give them to me and I light one up. I drag deep and soon it hit me and I feeling good. I mean I feel like everything fine and the world a good place to live and everybody doing the job what they got and nobody make trouble. Everything is just calm and nice and easy. I is a very smart cat what is woke to all the sounds.
...
Thats how pot make me feel. Peacefull. I want no trouble and I give no trouble.

Another instance, somewhat closer to the social justice sense, appears in Karlene Faith, Soledad Prison, University of the Poor: An Exchange Between Students from the University of California at Santa Cruz and Prisoners at the Soledad Correctional Training Facility (1975) [combined snippets]:

You have become too rigid/ + frigid/ + stupid/ + hung up/ in your dream to see that the lust for/ life will never yield/ to rules and bars/  or to godless/ heartless machines/ but will free us of the/ slavery of deceptive oppression,/ exploitation/ + the illusion of your dream./ Nothing comes to a sleeper but a dream Amerika/ + we are WOKE/ You are being condemned by your non-sleeping/ people Amerikan Dream/ We the people-/ in order to establish a more perfect union-/ Sentence you/ Amerikan Dream/ to humanism/ + awareness/ +/ love +/ peace/ + revolution/ + progressive/ social/ insomnia/ for the rest of your natural/ life 

One common source of mainstream slang terms is African American slang. But the likelihood that woke in its modern sense was current in African American slang as early as 1975 is diminished by the fact that neither Clarence Major, Juba to Jive: A Dictionary of African American Slang (1994) nor Geneva Smitherman, Black Talk: Words and Phrases from the Hood to the Amen Corner (1994) has an entry for woke in any sense. Likewise, slang dictionaries dedicated to American youth slang (Flappers 2 Rappers: American Youth Slang [1996]), hipster slang ((Straight from the Fridge, Dad: A Dictionary of Hipster Slang [1988/2004]), and college slang (Slang U.: The Official Dictionary of College Slang [1989]) do not mention woke.
The suggested origin in a 2008 song by Erykah Badu seems very plausible, given that popular songs provide a direct conduit to vast numbers of people. Nevertheless, the notion that woke can mean "aware of certain truths or realities that most other people have not yet grasped clearly" has antecedents from long before 2008.

A very early instance of woke in connection with social justice appears in Matilie Singerman, A Comparison of the Opinion of the Negro Leaders in World War I and World War II ... [combined snippets] (1945):

The idea that all labor must be united for the benefit of all workers was prevalent. It was felt that the craft union philosophy was becoming passé. Charles S. Johnson wrote 

"The ends of labor, as an equal partner in the production of goods and wealth cannot be served without the cooperation of all workers. This is in sharp contrast to the old craft union philosophy based, like the old industrial monopoly, upon the economy of scarcity. The new philosophy based, as a part of its own inherent logic, takes in Negro workers, and this logic has been fortified in some of the new powerful labor organizations by penalties for failure to
    enforce the policy of non-discrimination, and by a growing political solidarity.
"Negro workers are now recognizing in the new unions the most strategic weapons for [their own] advance[.] ..." 

J. Saunders Redding observed that 

"The South is learning the lesson taught a few months ago by R. J. Thomas, president of the United Automobile Workers, when he ordered back to work, under pain of expulsion from job and union, some Southern whites who struck in protest against the employment of Negroes in a Wright aeronautical factory. They mean that the Negro is coming to 'have faith in organized labor as a force for social justice.' They mean what a Negro United Mine Workers official in West Virginia told me in 1940: 'Let me tell you, buddy, waking up is a damn sight harder than going to sleep, but we'll stay woke up longer.'" 


The quotation from J. Saunders Redding originally appeared in Negro Digest, volume 1 (1942).
Equating awareness of—and an unwillingness to lose sight of—ideas of social justice with being awakened and "staying woke [up]" is sufficiently obvious and intuitive that we shouldn't be surprised to see instances of it extending fairly far backward in history. It doesn't follow that a continuous connection necessarily exists between very early instances of woke in the context of social justice and widespread slang or figurative use of it in that sense today.
