UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NPiZMoscxHRMP3m6gVe8fLPQvoYF9Z6END/Bncw/u/c=' 
WHERE 
  key_id = '7490a335427f6d727259926db652c86c6f35488a261dc141e5b910625dafcdd6' 
  AND (
    token = 'NPiZMoscxHRMP3m6gVe8fLPQvoYF9Z6END/Bncw/u/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031